import pandas as pd

repo_name_list = ["cmssw", "django", "kubernetes", "laravel", "moby", "opencv", "pandas", "rails", "react", "rust",
                  "salt", "scikit-learn", "symfony", "tensorflow", "terraform", "yii2"]
for repo_name in repo_name_list:
    file_name = "./learning to Rank/Results/" + repo_name + ".csv"
    # 假设你的数据存储在一个csv文件中，我们先读取它
    data = pd.read_csv(file_name)

    # 1. 修改表头
    data.columns = ['Model', 'Top/Rear', 'NDCG', 'MRR', 'KTD', 'SUM']

    # 2. 将SMF改为SSF
    data['Model'] = data['Model'].replace('SMF', 'SSF')

    # 3. 将True和False替换为Top和Rear
    data['Top/Rear'] = data['Top/Rear'].replace({True: 'Top', False: 'Rear'})

    # 然后将处理后的数据写回原文件或者新的文件
    data.to_csv(file_name, index=False)
